<div id="maincontent">
	<div id="content">
    
    <h2><?php echo lico_lang('machines', 'page.title'); ?></h2>
    
    <div class="box1">
      <?php
      include_once("libs/xml.class.php");
      $xml = file_get_contents("xml/machines_accounts.xml");
      $domObj = new xmlToArrayParser($xml);
      $domArr = $domObj->array;
      $generated = $domArr['statistics']['_']['generated'];
      $gesamt = 0;
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        $gesamt += intval($domArr['statistics']['line'][$a]['number']);
      }
      ?>
      <h3><?php echo lico_lang('machines', 'machines1.page.title'); ?></h3>
        <div class="description"><?php echo lico_lang('machines', 'machines1.page.description'); ?><br/><small>(Generated: <?php echo $generated; ?>)</small></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li users"><span><strong>Accounts</strong></span></li>
            <li class="infotable-li machines"><span><strong>Count</strong></span></li>
            <li class="infotable-li percent"><span><strong>Percent</strong></span></li>
          </ul>
        </div>
      <?php
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        if ($class == "odd") $class = "even"; else $class = "odd";
        $line = $domArr['statistics']['line'][$a];
        $percent = round((100/$gesamt) * intval($line['number']), 2);
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li users"><span><?php echo trim($line['accounts']); ?></span></li>
            <li class="infotable-li machines"><span><?php echo number_format($line['number']); ?></span></li>
            <li class="infotable-li percent"><?php echo lico_PercentBar($percent); ?></li>
          </ul>
        </div>
        <?php
      }
      ?>
      
    </div>
    
    
    
    
    
    
    
    <div class="box2">
      <?php
      include_once("libs/xml.class.php");
      $xml = file_get_contents("xml/machines_countries.xml");
      $domObj = new xmlToArrayParser($xml);
      $domArr = $domObj->array;
      $generated = $domArr['statistics']['_']['generated'];
      $gesamt = 0;
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        $gesamt += intval($domArr['statistics']['line'][$a]['machines']);
      }
      ?>
      <h3><?php echo lico_lang('machines', 'machines2.page.title'); ?></h3>
        <div class="description"><?php echo lico_lang('machines', 'machines2.page.description'); ?><br/><small>(Generated: <?php echo $generated; ?>)</small></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li users"><span><strong>Country</strong></span></li>
            <li class="infotable-li machines"><span><strong>Count</strong></span></li>
            <li class="infotable-li percent"><span><strong>Percent</strong></span></li>
          </ul>
        </div>
      <?php
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        if ($class == "odd") $class = "even"; else $class = "odd";
        $line = $domArr['statistics']['line'][$a];
        $percent = round((100/$gesamt) * intval($line['machines']), 2);
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li users"><span><?php echo trim($line['country']); ?></span></li>
            <li class="infotable-li machines"><span><?php echo number_format($line['machines']); ?></span></li>
            <li class="infotable-li percent"><?php echo lico_PercentBar($percent); ?></li>
          </ul>
        </div>
        <?php
      }
      ?>
      
    </div>
    
    
    
    
    
    
    
    <div class="box3">
      <?php
      include_once("libs/xml.class.php");
      $xml = file_get_contents("xml/machines_cpus.xml");
      $domObj = new xmlToArrayParser($xml);
      $domArr = $domObj->array;
      $generated = $domArr['statistics']['_']['generated'];
      $gesamt = 0;
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        $gesamt += intval($domArr['statistics']['line'][$a]['machines']);
      }
      $select = "SELECT sum(machines) AS sum FROM `processors`";
      $ret = $db->getAll_assoc($select);
      $summachines = intval($ret[0]['sum']);
      $description = str_replace("#summachines#", $summachines, lico_lang('machines', 'machines3.page.description'));
      ?>
      <h3><?php echo lico_lang('machines', 'machines3.page.title'); ?></h3>
        <div class="description"><?php echo $description; ?><br/><small>(Generated: <?php echo $generated; ?>)</small></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col37p"><span><strong>CPU</strong></span></li>
            <li class="infotable-li machines"><span><strong>Count</strong></span></li>
            <li class="infotable-li col50p"><span><strong>Percent</strong></span></li>
          </ul>
        </div>
      <?php
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        if ($class == "odd") $class = "even"; else $class = "odd";
        $line = $domArr['statistics']['line'][$a];
        $percent = round((100/$gesamt) * intval($line['machines']), 2);
        $herz = trim($line['herz']);
        if ($herz != "")
          $herz = " @ ".$herz."MHz";
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col37p"><span><?php echo trim($line['cpu']).$herz; ?></span></li>
            <li class="infotable-li machines"><span><?php echo number_format($line['machines']); ?></span></li>
            <li class="infotable-li col50p"><?php echo lico_PercentBar($percent); ?></li>
          </ul>
        </div>
        <?php
      }
      ?>
      
    </div>
    
    
    
    
    
    
    
    
    <div class="box4">
      <?php
      include_once("libs/xml.class.php");
      $xml = file_get_contents("xml/machines_complete_diskspace.xml");
      $domObj = new xmlToArrayParser($xml);
      $domArr = $domObj->array;
      $generated = $domArr['statistics']['_']['generated'];
      $gesamt = 0;
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        $gesamt += intval($domArr['statistics']['line'][$a]['number']);
      }
      ?>
      <h3><?php echo lico_lang('machines', 'machines4.page.title'); ?></h3>
        <div class="description"><?php echo lico_lang('machines', 'machines4.page.description'); ?><br/><small>(Generated: <?php echo $generated; ?>)</small></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col37p"><span><strong>Diskspace</strong></span></li>
            <li class="infotable-li machines"><span><strong>Count</strong></span></li>
            <li class="infotable-li col50p"><span><strong>Percent</strong></span></li>
          </ul>
        </div>
      <?php
      for ($a=0; $a<count($domArr['statistics']['line']); $a++) {
        if ($class == "odd") $class = "even"; else $class = "odd";
        $line = $domArr['statistics']['line'][$a];
        $percent = round((100/$gesamt) * intval($line['number']), 2);
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col37p"><span><?php echo trim($line['diskspace']); ?></span></li>
            <li class="infotable-li machines"><span><?php echo number_format($line['number']); ?></span></li>
            <li class="infotable-li col50p"><?php echo lico_PercentBar($percent); ?></li>
          </ul>
        </div>
        <?php
      }
      ?>
      
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
    
  </div>
</div>
